<script setup lang="ts">
import { addTag } from '@/api/system/tag';
import type { Tag } from '@/api/system/tag/type';
import { ref, type Ref } from 'vue';

const onShow = defineModel() as Ref<false>;
const formData = ref({} as Tag);

const onSubmit = () => {
    addTag(formData.value);
}

</script>

<template>
    <div>
        <el-dialog v-model="onShow" title="添加权限" width="500">
            <el-form :model="formData" label-width="auto" style="max-width: 600px">
                <el-form-item label="标签名">
                    <el-input v-model="formData.name" />
                </el-form-item>
                <el-form-item label="标签类型">
                    <el-input v-model="formData.type" />
                </el-form-item>
            </el-form>
            <div class="row">
                <el-button @click="onSubmit()" type="primary">提交</el-button>
                <el-button @click="onShow = false" type="primary">取消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<style lang="scss" scoped>

</style>